<template>
  <div>
     <van-nav-bar title="喜欢"/>
    <van-list

      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="getList"
>
  <ArticleItem v-for="item in articles " :key='item.id' :item='item'></ArticleItem>
</van-list>
  </div>
</template>

<script>
import ArticleItem from '@/components/ArticleItem.vue'
import { getoptList } from '@/api/user'
export default {
  name: 'LikePage',
  components: {
    ArticleItem
  },
  data () {
    return {
      articles: [],
      loading: false,
      finished: false

    }
  },
  async created () {
    const res = await getoptList(1)
    console.log(res.data.data.rows)
    this.articles = res.data.data.rows
    console.log(this.articles)
  },
  methods: {
    getList () {
      this.finished = true
    }
  }
}
</script>
